--** 创建者   : suning
--** 创建日期 : 20230406
--** 功能描述 ：全链路判责明细
--**************************************************************************
--**************************** 修改日志 ************************************
--**************************************************************************
--** 依赖表：
--**************************************************************************
--*******************  CURRENT_VERSION ： V.1.1  ***************************
create external table jms_dm.dm_cainiao_route_data_dt (
   in_from_provider_code           string comment '',
   in_from_provider_desc           string comment '',
   in_from_city_code               string comment '',
   in_from_city_desc               string comment '',
   in_from_area_code               string comment '',
   in_from_area_desc               string comment '',
   in_from_code                    string comment '',
   in_from_name                    string comment '',
   branch_in_center_span_days      string comment '',
   center_branch_out_span_days     string comment '',
   reserve_1                       string comment '',
   latest_warehousing_time_quantum string comment '',
   in_edge2_planned_departure      string comment '',
   in_to_code                      string comment '',
   in_edge_planned_departure       string comment '',
   in_line_day                     string comment '',
   in_ship_span_days               string comment '',
   extra_in_planned_arrival        string comment '',
   in_edge2_planned_arrival        string comment '',
   in_edge_planned_arrival         string comment '',
   e1_end_code                     string comment '',
   branch_in_center_stop_time      string comment '',
   center_branch_out_stop_time     string comment '',
   e1_planned_departure            string comment '',
   e1_runtime                      string comment '',
   e2_planned_departure            string comment '',
   e3_planned_departure            string comment '',
   e4_planned_departure            string comment '',
   e5_planned_departure            string comment '',
   e6_planned_departure            string comment '',
   e1_planned_arrival              string comment '',
   e2_planned_arrival              string comment '',
   e3_planned_arrival              string comment '',
   e4_planned_arrival              string comment '',
   e5_planned_arrival              string comment '',
   e6_planned_arrival              string comment '',
   e2_runtime                      string comment '',
   e3_runtime                      string comment '',
   e4_runtime                      string comment '',
   e5_runtime                      string comment '',
   e6_runtime                      string comment '',
   e1_e2_stop_time                 string comment '',
   e2_e3_stop_time                 string comment '',
   e3_e4_stop_time                 string comment '',
   e4_e5_stop_time                 string comment '',
   e5_e6_stop_time                 string comment '',
   e2_end_code                     string comment '',
   e3_end_code                     string comment '',
   e4_end_code                     string comment '',
   e5_end_code                     string comment '',
   e6_end_code                     string comment '',
   extra_out_planned_departure     string comment '',
   out_edge2_planned_departure     string comment '',
   out_edge_planned_departure      string comment '',
   out_to_provider_code            string comment '',
   out_to_provider_desc            string comment '',
   out_to_city_code                string comment '',
   out_to_city_desc                string comment '',
   out_to_area_code                string comment '',
   out_to_area_desc                string comment '',
   out_to_code                     string comment '',
   out_to_name                     string comment '',
   out_line_day                    string comment '',
   branch_out_span_days            string comment '',
   out_edge2_planned_arrival_time  string comment '',
   out_lastest_time                string comment '',
   is_main_route                   string comment '',
   search_type                     string comment '',
   out_collect_line_name           string comment '',
   e1_latest_warehousing           string comment '',
   e2_latest_warehousing           string comment '',
   e3_latest_warehousing           string comment '',
   e4_latest_arrival_time          string comment '',
   e5_latest_arrival_time          string comment '',
   e6_latest_arrival_time          string comment '',
   out_edge_latest_warehouse_time  string comment '',
   extra_out_latest_warehousing    string comment '',
   out_edge2_latest_warehouse_time string comment '',
   rn                              string comment '',
   is_true                         string comment ''
) COMMENT '菜鸟取数表'
PARTITIONED BY (dt STRING COMMENT '')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_cainiao_route_data_dt'
TBLPROPERTIES (
'discover.partitions'='false',
'parquet.column.index.access'='true'
);

ALTER TABLE jms_dm.dm_cainiao_route_data_dt add COLUMNS(
  in_last_shift_code  string COMMENT '集货班次',
  out_last_shift_code  string COMMENT '散货班次'
)cascade;

ALTER TABLE jms_dm.dm_cainiao_route_push_all_data_dt add COLUMNS(
  latest_warehousing_time_quantum  string COMMENT '揽收时间段',
  out_last_shift_code  string COMMENT '散货班次'
)cascade;

ALTER TABLE jms_dm.dm_cainiao_route_push_data_version2_dt add COLUMNS(
  latest_warehousing_time_quantum  string COMMENT '揽收时间段',
  out_last_shift_code  string COMMENT '散货班次'
)cascade;

ALTER TABLE jms_dm.dm_cainiao_route_push_all_data_dt add COLUMN(
  latest_warehousing_time_quantum  VARCHAR(200) COMMENT '揽收时间段',
  out_last_shift_code  VARCHAR(200) COMMENT '散货班次'
)
ALTER TABLE jms_dwd.dwd_cainiao_route_push_data add COLUMN(
  latest_warehousing_time_quantum  VARCHAR(200) COMMENT '揽收时间段',
  out_last_shift_code  VARCHAR(200) COMMENT '散货班次'
)

